package main.test.SparkAPI.Baics.traits

/**
 * Suppose you need to represent a zoo's
 * animals and make sure they all have some common behavior:
 * they all sleep, eat and move.
 * Let's define an interface to enforce these functionalities.
 */
trait Animal {
  def sleep = "ZzZ"
  def eat(food: String):String
  def move(x: Int, y: Int) :String

  /**
   * use the keyword trait and a name to identify an interface
   * In scala 2, a trait can have abstract and fully implemented codiing elements,
   * such as functions, values, and variables.
   */
}
